package com.worwkay.bean;

import java.io.IOException;

/**
 * Created by lidu on 14-8-28.
 */
public class DependentBean {
    private ResourceBean resourceBean;

    public void write(String ss) throws IOException {
        System.out.println("DependentBean--------------写资源");
        resourceBean.getFos().write(ss.getBytes());
    }

    //初始化方法
    public void init() throws IOException {
        System.out.println("DependentBean---------------初始化");
        resourceBean.getFos().write("DependentBean---------------初始化".getBytes());
    }

    //摧毁方法
    public void destroy() throws IOException {
        System.out.println("DependentBean---------------销毁");
        resourceBean.getFos().write("DependentBean---------------销毁".getBytes());
    }

    public void setResourceBean(ResourceBean resourceBean) {
        this.resourceBean = resourceBean;
    }
}
